<template>
  <!-- 房间表 -->
  <el-dialog :visible.sync="isShow" v-if="isShow" title="房间信息" width="58%" :before-close="handleClose" top="50px" 
  :close-on-click-modal="false">
    <div class="border-box">
      <el-form ref="roomForm" :model="formParams" :rules="roomForm" label-position="left">
        <div class="flex item-box" v-for="(item,index) in itemData" :key="index">
          <div class="title width25">
            {{ item.label }}<span :class="item.pass?'mustPass':'noMustPass'">*</span>
          </div>
          <div class="content width80">
            <el-form-item class="item-clear" v-show="item.key=='game_id'" label="" prop="game_id">
              <el-select v-model="formParams.game_id" placeholder="请选择游戏类型"  filterable disabled>
                <el-option :label="second.label" :value="second.value" v-for="(second, two) in GAME_TYPE" :key="two"></el-option>
                <el-option label="老虎机" :value="3"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_base_room_id'" label="" prop="a_base_room_id">
              <el-input-number :min="1" :max="999999999" :precision="0" v-model="formParams.a_base_room_id" controls-position="right" clearable placeholder="请输入房间ID"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_room_remark'" label="" prop="a_room_remark">
              <el-input class="width40" type="text" v-model="formParams.a_room_remark" clearable placeholder="请输入备注" />
            </el-form-item>
            <!-- 新手设置 -->
            <div class="item-clear" v-show="item.key=='a_user_newer'" label="" style="height:auto;">
              <div class="title flex">
                <span class="width25">新手送分模式每日次数</span>
                <el-form-item class="item-clear" label="" prop="a_user_newer_day">
                  <el-input-number :min="0" :max="9999999999" :precision="0" v-model="formParams.a_user_newer_day" controls-position="right" clearable placeholder="新手送分模式每日次数"/>
                </el-form-item>
              </div>
              <div class="title flex">
                <span class="width25">触发新手送分模式额度</span>
                <el-form-item class="item-clear" label="" prop="a_user_newer_send_limit">
                  <el-input-number :min="-1" :max="999999999999" :precision="0" v-model="formParams.a_user_newer_send_limit" controls-position="right" clearable placeholder="触发新手送分模式额度"/>
                </el-form-item>
              </div>
              <div class="title flex">
                <span class="width25">新手送分模式杀率</span>
                <el-form-item class="item-clear" label="" prop="a_user_newer_send_kill">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_user_newer_send_kill" controls-position="right" clearable placeholder="新手送分模式杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25">新手送分模式大杀率</span>
                <el-form-item class="item-clear" label="" prop="a_user_newer_send_bigkill">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_user_newer_send_bigkill" controls-position="right" clearable placeholder="新手送分模式大杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25">解除新手送分模式额度</span>
                <el-form-item class="item-clear" label="" prop="a_user_newer_send_quota">
                  <el-input-number :min="-1" :max="999999999999" :precision="0" v-model="formParams.a_user_newer_send_quota" controls-position="right" clearable placeholder="解除新手送分模式额度"/>
                </el-form-item>
              </div>
              <div class="title flex">
                <span class="width25">新手正常模式杀率</span>
                <el-form-item class="item-clear" label="" prop="a_game_normal_switch">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_game_normal_switch" controls-position="right" clearable placeholder="新手正常模式杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25">新手正常模式大杀率</span>
                <el-form-item class="item-clear" label="" prop="a_game_normal_kill">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_game_normal_kill" controls-position="right" clearable placeholder="新手正常模式大杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
            </div>
            <!-- 新手超额换牌 -->
            <div class="item-clear" v-show="item.key=='a_user_newerchangekill'" label="" style="height:auto;" >
              <div class="flex" v-for="(second,two) in killData" :key="two">
                <div class="btn-box-add">
                  <el-tooltip content="新增配置" v-show="killIndex==two">
                    <el-button size="mini" type="primary" circle icon="el-icon-plus" @click="addKill" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="下限额度" label-width="70px">
                  <el-input-number class="width160 marginR5" @change="newerchangekillValue" :min="0" :max="999999999999" :precision="0" v-model="second.min" controls-position="right" clearable placeholder="下限额度"/>
                </el-form-item>
                <el-form-item class="item-clear" label="上限额度" label-width="70px">
                  <el-input-number class="width160 marginR5" @change="newerchangekillValue" :min="0" :max="999999999999" :precision="0" v-model="second.max" controls-position="right" clearable placeholder="上限额度"/>
                </el-form-item>
                <el-form-item class="item-clear" label="概率" label-width="40px">
                  <el-input-number class="width150" :min="0" @change="newerchangekillValue" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="概率"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="killData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteKill(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <div class="item-clear" v-show="item.key=='a_robot_newbie'" style="height:auto;">
              <div class="title flex">
                <span class="width10">杀率</span>
                <el-form-item class="item-clear" label="" prop="user_new_kill">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.user_new_kill" controls-position="right" clearable placeholder="杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width10">大杀率</span>
                <el-form-item class="item-clear" label="" prop="user_new_killRate">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.user_new_killRate" controls-position="right" clearable placeholder="大杀率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25" style="line-height:20px">机器人强制弃牌时玩家押注占携带百分比</span>
                <el-form-item class="item-clear" label="" prop="user_new_discard">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.user_new_discard" controls-position="right" clearable placeholder="机器人强制弃牌时玩家押注占携带百分比"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
            </div>
            <!-- 非杀局闷牌轮次概率换牌 -->
            <div class="item-clear" v-show="item.key=='a_bind_change'" label="" style="height:auto;" >
              <div class="flex" v-for="(second,two) in changeData" :key="two">
                <div class="btn-box-add">
                  <el-tooltip content="新增配置" v-show="changeIndex==two">
                    <el-button size="mini" type="primary" circle icon="el-icon-plus" @click="addChange" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="Min轮" label-width="70px">
                  <el-input-number class="width160 marginR5" @change="changeValue" :min="0" :max="999999999999" :precision="0" v-model="second.min" controls-position="right" clearable placeholder="Min轮"/>
                </el-form-item>
                <el-form-item class="item-clear" label="Max轮" label-width="70px">
                  <el-input-number class="width160 marginR5" @change="changeValue" :min="0" :max="999999999999" :precision="0" v-model="second.max" controls-position="right" clearable placeholder="Max轮"/>
                </el-form-item>
                <el-form-item class="item-clear" label="概率" label-width="40px">
                  <el-input-number class="width150" :min="0" @change="changeValue" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="概率"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="changeData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteChange(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_unkill'" label="" prop="a_robot_unkill">
              <el-input-number class="width150" :min="0" :max="10000" :precision="0" v-model="formParams.a_robot_unkill" controls-position="right" clearable placeholder="请输入机器人玩家赢局概率"/>
            </el-form-item>
            <!-- 机器人陪跑局 -->
            <div class="item-clear" v-show="item.key=='a_robot_runwith'" label="" style="height:auto;" >
              <div class="title flex">
                <span class="width25">玩家赢局同意比牌轮次</span>
                <el-form-item class="item-clear" label="" prop="runwith_userNum" style="margin-right:5px">
                  <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.runwith_userNum" controls-position="right" clearable placeholder="请输入取消烂牌概率"/>
                </el-form-item>
                —
                概率：
                <el-form-item class="item-clear" label="" prop="runwith_userRate">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.runwith_userRate" controls-position="right" clearable placeholder="请输入概率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25" style="line-height:20px">杀率局同意比牌轮次</span>
                <el-form-item class="item-clear" label="" prop="runwith_userKill" style="margin-right:5px">
                  <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.runwith_userKill" controls-position="right" clearable placeholder="请输入取消烂牌概率"/>
                </el-form-item>
                —
                概率：
                <el-form-item class="item-clear" label="" prop="runwith_userKillRate">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.runwith_userKillRate" controls-position="right" clearable placeholder="请输入概率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25" style="line-height:20px">大杀率局同意比牌轮次</span>
                <el-form-item class="item-clear" label="" prop="runwith_userBigKill" style="margin-right:5px">
                  <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.runwith_userBigKill" controls-position="right" clearable placeholder="请输入取消烂牌概率"/>
                </el-form-item>
                —
                概率：
                <el-form-item class="item-clear" label="" prop="runwith_userBigKillRate">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.runwith_userBigKillRate" controls-position="right" clearable placeholder="请输入概率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
            </div>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_bigkill'" label="" prop="a_robot_bigkill">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_robot_bigkill" controls-position="right" clearable placeholder="请输入机器人大杀率触发概率"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_enter_need'" label="" prop="a_enter_need">
              <el-radio-group v-model="formParams.a_enter_need">
                <el-radio-button :label="1">充值</el-radio-button>
                <el-radio-button :label="0">暂无需求</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_user_real'" label="" prop="a_user_real">
              <el-radio-group v-model="formParams.a_user_real">
                <el-radio-button :label="0">机器人对局</el-radio-button>
                <el-radio-button :label="1">真人玩家对局</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_recharge_radio'" label="" prop="a_recharge_radio">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.a_recharge_radio" controls-position="right" clearable placeholder="请输入充值额度计算倍数"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_gold_limit_time'" label="" prop="a_gold_limit_time">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.a_gold_limit_time" controls-position="right" clearable placeholder="请输入进入房间门槛倍数"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_kick_time'" label="" prop="a_kick_time">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.a_kick_time" controls-position="right" clearable placeholder="请输入踢出房间倍数"/>
            </el-form-item>
            <!-- 卢比筹码兑换比例  -->
            <el-form-item class="item-clear" v-show="item.key=='a_slots_exchange'" label="" prop="a_slots_exchange">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_slots_exchange" controls-position="right" clearable placeholder="请输入卢比筹码兑换比例"/>%<span class="colorRed">(万分比)</span>
            </el-form-item>
            <!-- 压注金额大于多少倍 -->
            <div class="item-clear" v-show="item.key=='a_robot_changekill'" label="" style="height:auto;" >
              <div class="flex" v-for="(second,two) in changeKillData" :key="two">
                <div class="btn-box-add">
                  <el-tooltip content="新增配置" v-show="changeKillIndex==two">
                    <el-button size="mini" type="primary" circle icon="el-icon-plus" @click="addChangeKill" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="倍率" label-width="40px">
                  <el-input-number class="width160 marginR5" :min="0" :max="999999999999" :precision="0" v-model="second.round" controls-position="right" clearable placeholder="下限额度"/>
                </el-form-item>
                <el-form-item class="item-clear" label="概率" label-width="40px">
                  <el-input-number class="width150" :min="0" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="概率"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="changeKillData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteChangeKill(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <!-- 杀率局玩家弃牌后换牌倍数 -->
            <div class="item-clear" v-show="item.key=='a_robot_changepoker'" style="height:auto;">
              <div class="flex" v-for="(second,two) in changepokerData" :key="two">
                <div class="btn-box-add">
                  <el-tooltip content="新增配置" v-show="pokerIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addPoker" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="">
                  <el-input-number :min="0" :max="999999999999" :precision="0" v-model="second.min" controls-position="right" clearable placeholder="请输入换牌倍数Min"/>
                    —
                  <el-input-number :min="0" :max="999999999999" :precision="0" v-model="second.max" controls-position="right" clearable placeholder="请输入换牌倍数Max"/>
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="对应倍数权重"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="changepokerData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deletePoker(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <!-- 杀率局时Rm机器人胡牌控制 -->
            <div class="item-clear" v-show="item.key=='a_robot_rmkillcontrol'" style="height:auto;">
              <div class="flex" v-for="(second,two) in rmkillData" :key="two">
                <div class="btn-box-add">
                  <el-tooltip content="新增配置" v-show="rmkillIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addRmkill" />
                  </el-tooltip>
                </div>
                
                <el-form-item class="item-clear" label="">
                  第
                  <el-input-number class="width150" :min="0" :max="999999999999" :precision="0" v-model="second.round" controls-position="right" clearable placeholder="请输入轮次"/>
                  轮,
                </el-form-item>
                
                <el-form-item class="item-clear" label="概率:" label-width="50px">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="请输入胡牌概率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="rmkillData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteRmkill(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <!-- 杀率局时Rm玩家控制 -->
            <div class="item-clear" v-show="item.key=='a_user_rmkillcontrol'" style="height:auto;">
              <div class="title flex">
                <span class="width25">取消烂牌概率</span>
                <el-form-item class="item-clear" label="" prop="rmkillcontrol_cancel">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.rmkillcontrol_cancel" controls-position="right" clearable placeholder="请输入取消烂牌概率"/>
                </el-form-item><span class="colorRed">(万分比)</span>
              </div>
              <div class="title flex">
                <span class="width25" style="line-height:20px">玩家取消听牌时是否不让摸胡牌</span>
                <el-form-item class="item-clear" label="" prop="rmkillcontrol_card">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.rmkillcontrol_card" controls-position="right" clearable placeholder="请输入玩家取消听牌时是否不让摸胡牌"/>
                </el-form-item>
              </div>
              <div class="title flex">
                <span class="width25" style="line-height:20px">是否取消玩家拥有1st和2nd时1到2轮杀</span>
                <el-form-item class="item-clear" label="" prop="rmkillcontrol_control">
                  <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.rmkillcontrol_control" controls-position="right" clearable placeholder="请输入玩家取消听牌时是否不让摸胡牌"/>
                </el-form-item>
              </div>
            </div>
            <el-form-item title="底金区间变化" class="item-clear" v-show="item.key=='a_gold_change'" label="" prop="a_gold_change">
              <el-input-number :min="0"  :max="10000" :precision="0" v-model="formParams.a_gold_change" controls-position="right" clearable placeholder="请输入踢出房间倍数"/>
            </el-form-item>
            <el-form-item title="底金/每分额度" class="item-clear" v-show="item.key=='a_gold_boot'" label="" prop="a_gold_boot">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.a_gold_boot" controls-position="right" clearable placeholder="请输入底金区间下限值"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_gold_boot_section'" label="" prop="a_gold_boot_section">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.a_gold_boot_low" controls-position="right" clearable placeholder="请输入底金区间下限值"/>
                —
              <el-input-number :min="-1" :max="999999999999" :precision="0" v-model="formParams.a_gold_boot_up" controls-position="right" clearable placeholder="请输入底金区间上限值"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_user_limit'" label="" prop="a_user_limit">
              <el-input-number :min="0" :max="5" :precision="0" v-model="formParams.a_user_limit" controls-position="right" clearable placeholder="请输入房间最大真人数量"/>
            </el-form-item>
            <!-- A豹 -->
            <div class="item-clear" v-show="item.key=='a_user_set'" label="" prop="a_user_set" style="height:auto;">
              <div class="flex marginB10" v-for="(second,two) in leopardData" :key="two" style="background-color:#F9F9F9;">
                <div class="btn-box-add marginR20">
                  <el-tooltip content="新增配置" v-show="leopardIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addLeopard" />
                  </el-tooltip>
                </div>
                <div>
                  <div class="title flex">
                    <span class="width60 marginR5">玩家携带触发底注倍数下限</span>
                    <el-form-item class="item-clear" label="">
                      <el-input-number :min="0" @change="setValue" :max="999999999999" :precision="0" v-model="second.min" controls-position="right" clearable placeholder="玩家携带触发底注倍数下限"/>
                    </el-form-item>
                  </div>
                  <div class="title flex">
                    <span class="width60 marginR5">玩家携带触发底注倍数上限</span>
                    <el-form-item class="item-clear" label="">
                      <el-input-number :min="0" @change="setValue" :max="999999999999" :precision="0" v-model="second.max" controls-position="right" clearable placeholder="玩家携带触发底注倍数上限"/>
                    </el-form-item>
                  </div>
                  <div class="title flex">
                    <span class="width60 marginR5">触发概率</span>
                    <el-form-item class="item-clear" label="">
                      <el-input-number :min="0" @change="setValue" :max="10000" :precision="0" v-model="second.chance" controls-position="right" clearable placeholder="触发概率"/>
                    </el-form-item>
                  </div>
                  <div class="title flex">
                    <span class="width60 marginR5">充值额度计算倍数</span>
                    <el-form-item class="item-clear" label="">
                      <el-input-number :min="0" @change="setValue" :max="999999999" :precision="0" v-model="second.multiple" controls-position="right" clearable placeholder="充值额度计算倍数"/>
                    </el-form-item>
                  </div>
                </div>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="leopardData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteLeopard(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <el-form-item class="item-clear" v-show="item.key=='a_user_setcool'" label="" prop="a_user_setcool">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_user_setcool" controls-position="right" clearable placeholder="请输入A豹冷却局数"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_join'" label="" prop="a_robot_join">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_robot_join" controls-position="right" clearable placeholder="请输入机器人直接注入概率"/>%<span class="colorRed">(万分比)</span>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_join_num'" label="" prop="a_robot_join_num">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.num_min" controls-position="right" clearable placeholder="请输入机器人直接注入数量Min"/>
                —
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.num_max" controls-position="right" clearable placeholder="请输入机器人直接注入数量Max"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_bring'" label="" prop="a_robot_bring">
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.bring_min" controls-position="right" clearable placeholder="请输入机器人直接注入数量Min"/>
                —
              <el-input-number :min="0" :max="999999999999" :precision="0" v-model="formParams.bring_max" controls-position="right" clearable placeholder="请输入机器人直接注入数量Max"/>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_match'" label="" prop="a_robot_match">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_robot_match" controls-position="right" clearable placeholder="请输入机器人匹配阶段注入概率"/>%<span class="colorRed">(万分比)</span>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_kill'" label="" prop="a_robot_kill">
              <el-input-number :min="0" :max="10000" :precision="0" v-model="formParams.a_robot_kill" controls-position="right" clearable placeholder="请输入机器人匹配阶段注入概率"/>%<span class="colorRed">(万分比)</span>
            </el-form-item>
            <el-form-item class="item-clear" v-show="item.key=='a_robot_exit_num'" label="" prop="a_robot_exit_num">
              <el-input-number :min="0" :max="999999999" :precision="0" v-model="formParams.a_robot_exit_num" controls-position="right" clearable placeholder="请输入机器人最大退出次数限制"/>
            </el-form-item>
            <!-- slots单线押注筹码数 -->
            <div class="item-clear" v-show="item.key=='a_slots_amount'" style="height:auto;">
              <div class="flex" v-for="(second,two) in amountData" :key="two">
                <div class="btn-box-add marginR20">
                  <el-tooltip content="新增配置" v-show="amountIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addAmount" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="档位:" label-width="50px">
                  <el-input-number class="width120 marginR10" @change="amountValue" :min="0" :max="999999999999" :precision="0" v-model="second.gears" controls-position="right" clearable placeholder="下注筹码数"/>
                </el-form-item>
                <el-form-item class="item-clear" label="筹码:" label-width="50px">
                  <el-input-number class="width150" @change="amountValue" :min="0" :max="999999999999" :precision="0" v-model="second.num" controls-position="right" clearable placeholder="下注筹码数"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="amountData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteAmount(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <!-- 初始RTP -->
            <el-form-item class="item-clear" v-show="item.key=='a_slots_rtp'" label="" prop="a_slots_rtp">
              <el-select v-model="formParams.a_slots_rtp" placeholder="请选择RTP"  filterable>
                <el-option :label="second.num" :value="second.num" v-for="(second, two) in rtpshowData" :key="two"></el-option>
              </el-select>
              %<span class="colorRed">(百分比)</span>
            </el-form-item>
            <!-- 后台RTP显示 -->
            <div class="item-clear" v-show="item.key=='a_slots_rtpshow'" style="height:auto;">
              <div class="flex" v-for="(second,two) in rtpshowData" :key="two">
                <div class="btn-box-add marginR20">
                  <el-tooltip content="新增配置" v-show="rtpshowIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addRtpShow" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="RTP:" label-width="50px">
                  <el-input-number class="width180" :min="0" :max="20000" :precision="0" v-model="second.num" controls-position="right" clearable placeholder="RTP"/>%<span class="colorRed">(百分比)</span>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="rtpshowData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteRtpShow(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
            <!-- 百人场下注额度 -->
            <div class="item-clear" v-show="item.key=='a_hundred_amount'" style="height:auto;">
              <div class="flex" v-for="(second,two) in hundredData" :key="two">
                <div class="btn-box-add marginR20">
                  <el-tooltip content="新增配置" v-show="hundredIndex==two">
                    <el-button class="marginL10" size="mini" type="primary" circle icon="el-icon-plus" @click="addHundred" />
                  </el-tooltip>
                </div>
                <el-form-item class="item-clear" label="下注额度:" label-width="80px">
                  <el-input-number class="width180" :min="0" :max="100000" :precision="0" v-model="second.num" controls-position="right" clearable placeholder="下注筹码数"/>
                </el-form-item>
                <div class="btn-box-delete" label-width="60px">
                  <el-tooltip content="删除配置" v-show="hundredData.length != 1">
                    <el-button class="marginL10" size="mini" type="danger" circle icon="el-icon-minus" @click="deleteHundred(two)" />
                  </el-tooltip>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="medium" @click="handleClose">取 消</el-button>
      <el-button size="medium" type="primary" @click="handleConfirm('roomForm')">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import {
  addRoom,
  editRoom
} from '@/api/game'
import {
  GAME_TYPE
} from '@/utils/enum'

export default {
  components: {},
  props: {
    show: {
      type: Boolean,
      default: false
    },
    data: {
      type: Object,
      default: function () {
        return {}
      }
    },
    gameType: {
      type: Number,
      default: 1
    },
  },
  data () {
    return {
      GAME_TYPE,
      isShow: false,
      itemData:[
        { label: '游戏类型', key: 'game_id' },
        { label: '房间ID', key: 'a_base_room_id' ,pass:true},
        { label: '备注', key: 'a_room_remark' },
        { label: '进入房间门要求', key: 'a_enter_need' ,},
        { label: '房间对局', key: 'a_user_real' ,},
        { label: '进入房间门槛倍数', key: 'a_gold_limit_time' ,pass:true},
        { label: '踢出房间倍数', key: 'a_kick_time' ,pass:true},
        { label: '卢比筹码兑换比例', key: 'a_slots_exchange' ,},
        { label: '压注金额大于多少倍', key: 'a_robot_changekill' ,pass:true},
        { label: '新手设置', key: 'a_user_newer' },
        { label: '新手超额换牌', key: 'a_user_newerchangekill' },
        { label: '初入进入房间杀率配置', key: 'a_robot_newbie' },
        { label: '非杀局闷牌轮次概率', key: 'a_bind_change' },
        { label: '机器人玩家赢局概率', key: 'a_robot_unkill' },
        { label: '机器人陪跑局', key: 'a_robot_runwith' },
        { label: '机器人大杀率触发概率', key: 'a_robot_bigkill' },
        { label: '杀率局玩家弃牌后换牌倍数', key: 'a_robot_changepoker' ,pass:true},
        { label: '杀率局时Rm机器人胡牌控制', key: 'a_robot_rmkillcontrol' },
        { label: '杀率局时Rm玩家控制', key: 'a_user_rmkillcontrol' },
        { label: '底金区间变化', key: 'a_gold_change' },
        { label: '底金/每分额度', key: 'a_gold_boot' },
        { label: '底金区间值', key: 'a_gold_boot_section' ,pass:true},
        { label: '房间最大真人数量', key: 'a_user_limit' },
        { label: 'A豹配置', key: 'a_user_set' },
        { label: 'A豹冷却局数', key: 'a_user_setcool' },
        { label: '充值额度计算倍数', key: 'a_recharge_radio' },
        { label: '机器人直接注入概率', key: 'a_robot_join' },
        { label: '机器人直接注入数量', key: 'a_robot_join_num' ,pass:true},
        { label: '机器人进场携带金额', key: 'a_robot_bring' ,pass:true},
        { label: '机器人匹配阶段注入概率', key: 'a_robot_match' },
        { label: '机器人杀率触发概率', key: 'a_robot_kill' },
        { label: '机器人最大退出次数限制', key: 'a_robot_exit_num' },
        { label: 'slots单线押注筹码数', key: 'a_slots_amount' },
        { label: '初始RTP', key: 'a_slots_rtp' },
        { label: '后台RTP显示', key: 'a_slots_rtpshow' },
        { label: '百人场下注额度', key: 'a_hundred_amount' },
      ],
      formParams: {
        game_id:this.gameType,
        a_base_room_id: 0,
        a_room_remark: '',
        a_robot_newbie:'',
        a_bind_change:'',
        a_robot_unkill:0,
        user_new_kill:0,
        user_new_killRate:0,
        user_new_discard:0,
        a_slots_exchange:0,
        a_robot_changekill: '',
        a_robot_changepoker: '',
        a_robot_rmkillcontrol:'',
        a_user_rmkillcontrol:'',
        a_slots_amount:'',
        a_slots_rtp: 0,
        a_slots_rtpshow:'',
        a_hundred_amount:'',
        rmkillcontrol_cancel:0, //是否取消烂牌
        rmkillcontrol_card:0, //玩家取消听牌时是否不让摸胡牌
        rmkillcontrol_control:0, //是否取消玩家拥有1st和2nd时1到2轮杀
        a_robot_runwith:'',
        runwith_userNum: 0,
        runwith_userRate: 0,
        runwith_userKill: 0,
        runwith_userKillRate: 0,
        runwith_userBigKill: 0,
        runwith_userBigKillRate: 0,
        a_robot_bigkill: 0,
        a_gold_limit_time: 0,
        a_enter_need: 0,
        a_user_real: 0,
        a_kick_time: 0,
        a_gold_change: 0,
        a_gold_boot:0,
        a_gold_boot_low: 0,
        a_gold_boot_up: 0,
        a_user_limit: 1,
        a_user_newer:'',
        a_user_newer_day:'', // 新手送分模式每日次数
        a_user_newer_send_limit:'', // 触发新手送分模式额度
        a_user_newer_send_kill:'', // 新手送分模式杀率
        a_user_newer_send_bigkill:'', // 新手送分模式大杀率
        a_user_newer_send_quota:'', //  解除新手送分模式额度
        a_game_normal_switch:'', //  新手正常模式杀率
        a_game_normal_kill:'', // 新手正常模式大杀率
        a_user_newerchangekill:'',
        a_recharge_radio:0,
        a_user_set:'',
        a_user_setcool:0,
        a_robot_join: 0,
        a_robot_join_num: 0,
        num_min: 0,
        num_max: 0,
        a_robot_bring: '',
        bring_min: 0,
        bring_max: 0,
        a_robot_match: 0,
        a_robot_kill: 0,
        a_robot_exit_num: 0,
      },
      roomForm: {
        game_id: [{ required: true, trigger: 'blur', message: '请选择游戏类型', }],
        a_base_room_id: [{ required: true, trigger: 'blur', message: '请输入房间ID', }],
        a_gold_limit_time: [{ required: true, trigger: 'blur', message: '请输入进入房间门槛倍数', }],
        a_kick_time: [{ required: true, trigger: 'blur', message: '请输入踢出房间倍数', }],
      },
      rmkillData:[
        {round:0,chance:0}
      ],
      rmkillIndex:0,
      changeData:[
        {min:0,max:0,chance:0}
      ],
      changeIndex:0,
      changepokerData:[
        {min:0,max:0,chance:0}
      ],
      pokerIndex:0,
      amountData:[
        {gears:0,num:0}
      ],
      amountIndex:0,
      rtpshowData:[
        {num:0}
      ],
      rtpshowIndex:0,
      hundredData:[
        {num:0}
      ],
      hundredIndex:0,
      leopardData:[
        {min:0,max:0,chance:0,multiple:0}
      ],
      leopardIndex:0,
      killData:[
        {min:0,max:0,chance:0}
      ],
      killIndex:0,
      changeKillData:[
        {round:0,chance:0}
      ],
      changeKillIndex:0,
      newerchangekillValueShow:false,
      changeValueShow:false,
      setValueShow:false,
      amountShow:false,
    }
  },
  computed: {},
  watch: {
    show: function () {
      let that = this, num= [],changekill=[];
      that.isShow = that.show
      if (that.data) {
        // 自定义 默认值
        that.data.a_user_newer_day=''
        that.data.a_user_newer_send_limit=''
        that.data.a_user_newer_send_kill=''
        that.data.a_user_newer_send_bigkill=''
        that.data.a_user_newer_send_quota=''
        that.data.a_game_normal_switch=''
        that.data.a_game_normal_kill=''
        that.data.runwith_userNum=0
        that.data.runwith_userRate=0
        that.data.runwith_userKill=0
        that.data.runwith_userKillRate=0
        that.data.runwith_userBigKill=0
        that.data.runwith_userBigKillRate=0
        that.data.num_min=0
        that.data.num_max=0
        that.data.rmkillcontrol_cancel=0
        that.data.rmkillcontrol_card=0
        that.data.rmkillcontrol_control=0

        let  params = JSON.parse(JSON.stringify(that.data));
        
        // 初入进入房间杀率配置
        if(params.newbie.length){
          params.user_new_kill=params.newbie[0]
          params.user_new_killRate=params.newbie[1]
          params.user_new_discard=params.newbie[2]
        }
        // 非杀局闷牌轮次概率
        if(params.changeClose.length){
          that.changeData=params.changeClose
          that.changeIndex=that.changeData.length-1
          that.changeValueShow=true
        }else{
          that.changeData=[{min:0,max:0,chance:0}]
          that.changeIndex=0
          that.changeValueShow=false
        }
        // 单线程筹码押注数
        if(params.slotsAmount.length){
          that.amountData=params.slotsAmount
          that.amountIndex=that.amountData.length-1
          that.amountShow=true
        }else{
          that.amountData=[{gears:0,num:0}]
          that.amountIndex=0
          that.amountShow=false
        }
        // 后台RTP显示
        if(params.slotsRtpshow.length){
          that.rtpshowData=params.slotsRtpshow
          that.rtpshowIndex=that.rtpshowData.length-1
        }else{
          that.rtpshowData=[{num:0}]
          that.rtpshowIndex=0
        }
        // 百人场下注额度
        if(params.slotsHundred.length){
          that.hundredData=params.slotsHundred
          that.hundredIndex=that.hundredData.length-1
        }else{
          that.hundredData=[{num:0}]
          that.hundredIndex=0
        }
        // 杀率局玩家弃牌后换牌倍数
        if(params.changepoker.length){
          that.changepokerData=params.changepoker
          that.pokerIndex=that.changepokerData.length-1
        }else{
          that.changepokerData=[{min:0,max:0,chance:0}]
          that.pokerIndex=0
        }
        // 机器人陪跑局
        if(params.runwith.length){
          params.runwith_userNum=params.runwith[0][0]
          params.runwith_userRate=params.runwith[0][1]
          params.runwith_userKill=params.runwith[1][0]
          params.runwith_userKillRate=params.runwith[1][1]
          params.runwith_userBigKill=params.runwith[2][0]
          params.runwith_userBigKillRate=params.runwith[2][1]
        }else{
          that.a_robot_runwith=''
        }
        // 杀率局时Rm机器人胡牌控制
        if(params.rmkill.length){
          that.rmkillData=params.rmkill
          that.rmkillIndex=that.rmkillData.length-1
        }else{
          that.rmkillData=[{round:0,chance:0}]
          that.rmkillIndex=0
        }
        // 杀率局时Rm玩家控制
        if(params.userRmkill.length){
          params.rmkillcontrol_cancel=params.userRmkill[0]
          params.rmkillcontrol_card=params.userRmkill[1]
          params.rmkillcontrol_control=params.userRmkill[2]
        }
        // 机器人入场携带金额
        if(params.a_robot_bring.length){
          params.bring_min=params.a_robot_bring[0]
          params.bring_max=params.a_robot_bring[1]
        }
        // 新手设置
        if(params.newer){
          params.a_user_newer_day=params.newer[0]
          params.a_user_newer_send_limit=params.newer[1]
          params.a_user_newer_send_kill=params.newer[2]
          params.a_user_newer_send_bigkill=params.newer[3]
          params.a_user_newer_send_quota=params.newer[4]
          params.a_game_normal_switch=params.newer[5]
          params.a_game_normal_kill=params.newer[6]
        }
        // 机器人直接注入数量
        if(params.a_robot_join_num){
          num=params.a_robot_join_num.split(',')
          if(num.length){
            params.num_min=num[0]
            params.num_max=num[1]
          }
        }
        // 压注金额大于多少倍
        if(params.a_robot_changekill){
          that.changeKillData=params.changekill
          that.changeKillIndex=that.changeKillData.length-1
        }else{
          that.changeKillData=[{round:0,chance:0}]
          that.changeKillIndex=0
        }
        // A豹配置
        if(params.leopard.length){
          that.leopardData=params.leopard
          that.leopardIndex=that.leopardData.length-1
          that.setValueShow=true
        }else{
          that.leopardData=[{min:0,max:0,chance:0,multiple:0}]
          that.leopardIndex=0
          that.setValueShow=false
        }
        // 新手超额换牌
        if(params.newerchangekill.length){
          that.killData=params.newerchangekill
          that.killIndex=that.killData.length-1
          that.newerchangekillValueShow=true
        }else{
          that.killData=[{min:0,max:0,chance:0}]
          that.killIndex=0
          that.newerchangekillValueShow=false
        }
        that.formParams= JSON.parse(JSON.stringify(params));
      } else {
        that.formParams = {
          game_id:this.gameType,
          a_base_room_id: 0,
          a_room_remark: '',
          a_robot_newbie:'',
          a_bind_change:'',
          a_robot_unkill:0,
          user_new_kill:0,
          user_new_killRate:0,
          user_new_discard:0,
          a_slots_exchange:0,
          a_robot_changekill: '',
          a_robot_changepoker: '',
          a_robot_rmkillcontrol:'',
          a_user_rmkillcontrol:'',
          a_slots_amount:'',
          a_slots_rtp: 0,
          a_slots_rtpshow:'',
          a_hundred_amount:'',
          rmkillcontrol_cancel:0, //是否取消烂牌
          rmkillcontrol_card:0, //玩家取消听牌时是否不让摸胡牌
          rmkillcontrol_control:0, //是否取消玩家拥有1st和2nd时1到2轮杀
          a_robot_runwith:'',
          runwith_userNum: 0,
          runwith_userRate: 0,
          runwith_userKill: 0,
          runwith_userKillRate: 0,
          runwith_userBigKill: 0,
          runwith_userBigKillRate: 0,
          a_robot_bigkill: 0,
          a_gold_limit_time: 0,
          a_enter_need: 0,
          a_user_real: 0,
          a_kick_time: 0,
          a_gold_change: 0,
          a_gold_boot:0,
          a_gold_boot_low: 0,
          a_gold_boot_up: 0,
          a_user_limit: 1,
          a_user_newer:'',
          a_user_newer_day:'', // 新手送分模式每日次数
          a_user_newer_send_limit:'', // 触发新手送分模式额度
          a_user_newer_send_kill:'', // 新手送分模式杀率
          a_user_newer_send_bigkill:'', // 新手送分模式大杀率
          a_user_newer_send_quota:'', //  解除新手送分模式额度
          a_game_normal_switch:'', //  新手正常模式杀率
          a_game_normal_kill:'', // 新手正常模式大杀率
          a_user_newerchangekill:'',
          a_recharge_radio:0,
          a_user_set:'',
          a_user_setcool:0,
          a_robot_join: 0,
          a_robot_join_num: 0,
          num_min: 0,
          num_max: 0,
          a_robot_bring: '',
          bring_min: 0,
          bring_max: 0,
          a_robot_match: 0,
          a_robot_kill: 0,
          a_robot_exit_num: 0,
        }
      }
    },
  },
  mounted () {},
  methods: {
    // 确认
    handleConfirm (formvalue) {
      let that = this, params = JSON.parse(JSON.stringify(that.formParams));
      params.a_gold_change=that.$public.mathNumberMultiply(params.a_gold_change,10000)
      // 新手设置
      if(params.a_user_newer_send_kill || params.a_user_newer_send_limit || params.a_user_newer_send_bigkill || params.a_game_normal_switch  || params.a_game_normal_kill){
        params.a_user_newer=params.a_user_newer_day+','+params.a_user_newer_send_limit*10000+','+params.a_user_newer_send_kill+','+
        params.a_user_newer_send_bigkill+','+params.a_user_newer_send_quota*10000+','+params.a_game_normal_switch+','+params.a_game_normal_kill
      }else{
        params.a_user_newer=''
      }
      if(params.a_user_newer && params.a_user_newer.indexOf('undefined')!=-1){
        return that.$message.error('新手设置错误')
      }
      // 初入进入房间杀率配置
      if(params.user_new_kill || params.user_new_killRate || params.user_new_discard){
        params.a_robot_newbie=params.user_new_kill+','+params.user_new_killRate+','+params.user_new_discard
      }else{
        params.a_robot_newbie=''
      }
      if(params.a_robot_newbie && params.a_robot_newbie.indexOf('undefined')!=-1){
        return that.$message.error('初入进入房间杀率配置设置错误')
      }
      // 杀率局时Rm机器人胡牌控制
      if(that.rmkillData.length>1 || that.rmkillData[0].chance){
        params.a_robot_rmkillcontrol=that.rmkillDataBack(that.rmkillData)
      }else{
        params.a_robot_rmkillcontrol=''
      }
      // 非杀局闷牌轮次概率
      if(that.changeData.length && that.changeValueShow){
        params.a_bind_change=that.changeDataBack(that.changeData)
      }else{
        params.a_bind_change=''
      }
      // 机器人陪跑局
      if(params.runwith_userNum || params.runwith_userKill || params.runwith_userBigKill){
        params.a_robot_runwith=params.runwith_userNum+','+params.runwith_userRate+';'+params.runwith_userKill+','+params.runwith_userKillRate+';'+params.runwith_userBigKill+','+params.runwith_userBigKillRate
      }else{
        params.a_robot_runwith=''
      }
      
      // 杀率局时Rm玩家控制
      if(params.rmkillcontrol_cancel || params.rmkillcontrol_card || params.rmkillcontrol_control){
        params.a_user_rmkillcontrol=params.rmkillcontrol_cancel+','+params.rmkillcontrol_card+','+params.rmkillcontrol_control
      }else{
        params.a_user_rmkillcontrol=''
      }
      if(params.a_user_rmkillcontrol && params.a_user_rmkillcontrol.indexOf('undefined')!=-1){
        return that.$message.error('杀率局时Rm玩家控制配置设置错误')
      }
      // 新手超额换牌
      if(that.killData.length && that.newerchangekillValueShow){
        params.a_user_newerchangekill=that.userDataBack(that.killData)
      }else{
        params.a_user_newerchangekill=''
      }
      // A豹设置
      if(that.leopardData.length && that.setValueShow){
        params.a_user_set=that.leopardDataBack()
      }else{
        params.a_user_set=''
      }
      // 杀率局玩家弃牌后换牌倍数
      if(that.changepokerData.length>1 || that.changepokerData[0].max || that.changepokerData[0].chance){
        params.a_robot_changepoker=that.arrDataBack(that.changepokerData)
      }else{
        params.a_robot_changepoker=''
      }
      // 底金区间值
      if(params.a_gold_boot_up){
        if(params.a_gold_boot_up!=-1 && params.a_gold_boot_low>params.a_gold_boot_up){
          return that.$message.error('请输入正确的底金区间值')
        }
      }
      // 注入数量
      if(params.num_max){
          if(params.num_min>params.num_max){
          return that.$message.error('请输入正确的机器人直接注入数量')
        }
        params.a_robot_join_num=params.num_min+','+params.num_max
        if(params.a_robot_join_num && params.a_robot_join_num.indexOf('undefined')!=-1){
          return that.$message.error('器人直接注入数量配置设置错误')
        }
      }else{
        params.a_robot_join_num=''
      }
      // 机器人进场携带金额
      if(params.a_robot_bring){
        if(params.bring_min>params.bring_max){
          return that.$message.error('请输入正确的机器人进场携带金额')
        }
        params.a_robot_bring=params.bring_min+','+params.bring_max
        if(params.a_robot_bring && params.a_robot_bring.indexOf('undefined')!=-1){
          return that.$message.error('机器人进场携带金额配置设置错误')
        }
      }else{
        params.a_robot_bring=''
      }
      // 机器人压注金额倍数
      if(that.changeKillData.length>1 || that.changeKillData[0].chance){
        params.a_robot_changekill=that.rmkillDataBack(that.changeKillData)
      }else{
        params.a_robot_changekill=''
      }
      // 单线程筹码押注数
      if(that.amountData.length && that.amountShow){
        params.a_slots_amount=that.amountDataBack(that.amountData)
      }else{
        params.a_slots_amount=''
      }
      // 后台RTP显示 
      if(that.rtpshowData.length>1 || that.rtpshowData[0].num){
        params.a_slots_rtpshow=that.rtpshowDataBack(that.rtpshowData)
      }else{
        params.a_slots_rtpshow=''
      }
      // 百人场下注额度 
      if(that.hundredData.length>1 || that.hundredData[0].num){
        params.a_hundred_amount=that.hundredDataBack(that.hundredData)
      }else{
        params.a_hundred_amount=''
      }
      that.$refs[formvalue].validate((valid) => {
        if (valid) {
          // 新增
          if (!params.id) {
            addRoom(params).then(function (res) {
              that.$message.success(res.msg)
              that.$emit('onHideDetails', true)
            }).catch((error) => {
              that.$message.error(error.msg)
            })
          } else {
            editRoom(params).then(function (res) {
              that.$message.success(res.msg)
              that.$emit('onHideDetails', true)
            }).catch((error) => {
              that.$message.error(error.msg)
            })
          }
        } else {
          return false;
        }
      });
    },
    // 新增配置【杀率局时Rm机器人胡牌控制】
    addRmkill () {
      this.rmkillIndex++
      this.rmkillData.push({round:0,chance:0})
    },
    deleteRmkill (index) {
      this.rmkillIndex--
      this.rmkillData.splice(index, 1,)
    },
    rmkillDataBack(arr){
      let reward='';
      arr.map(item=>{
        reward+=item.round+','+item.chance+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 新增配置【杀率局玩家弃牌后换牌倍数】
    addPoker () {
      this.pokerIndex++
      this.changepokerData.push({min:0,max:0,chance:0})
    },
    deletePoker (index) {
      this.pokerIndex--
      this.changepokerData.splice(index, 1,)
    },
    arrDataBack(arr){
      let reward='';
      arr.map(item=>{
        reward+=item.min+','+item.max+','+item.chance+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    userDataBack(arr){
      let reward='';
      arr.forEach(item=>{
        reward+=item.min+','+item.max+','+item.chance+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 新增【A豹配置】
    addLeopard () {
      this.leopardIndex++
      this.leopardData.push({min:0,max:0,chance:0,multiple:0})
    },
    deleteLeopard (index) {
      this.leopardIndex--
      this.leopardData.splice(index, 1,)
    },
    leopardDataBack(){
      let arr=this.leopardData,reward='';
      arr.map(item=>{
        reward+=item.min+','+item.max+','+item.chance+','+item.multiple+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 新增【压注金额大于多少倍】
    addChangeKill () {
      this.changeKillIndex++
      this.changeKillData.push({round:0,chance:0})
    },
    deleteChangeKill (index) {
      this.changeKillIndex--
      this.changeKillData.splice(index, 1,)
    },
    // 新增【新手超额配置】
    addKill () {
      this.killIndex++
      this.killData.push({min:0,max:0,chance:0})
    },
    deleteKill (index) {
      this.killIndex--
      this.killData.splice(index, 1,)
    },
    // 新增【非杀局闷牌轮次概率换牌】
    addChange () {
      this.changeIndex++
      this.changeData.push({min:0,max:0,chance:0})
    },
    deleteChange (index) {
      this.changeIndex--
      this.changeData.splice(index, 1,)
    },
    changeDataBack(arr){
      let reward='';
      arr.forEach(item=>{
        reward+=item.min+','+item.max+','+item.chance+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 新增配置【单线押注筹码数】
    addAmount () {
      this.amountIndex++
      this.amountData.push({gears:0,num:0})
    },
    deleteAmount (index) {
      this.amountIndex--
      this.amountData.splice(index, 1,)
    },
    amountDataBack(arr){
      let reward='';
      arr.map(item=>{
        reward+=item.gears+','+item.num+';'
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 新增配置【后台RTP配置】
    addRtpShow () {
      this.rtpshowIndex++
      this.rtpshowData.push({num:0})
    },
    deleteRtpShow (index) {
      this.rtpshowIndex--
      this.rtpshowData.splice(index, 1,)
    },
    rtpshowDataBack(arr){
      let reward='';
      arr.forEach(item=>{
        reward+=item.num+','
      })
      reward = reward.substring(0, reward.length - 1)
      return reward
    },
    // 新增配置【后台RTP配置】
    addHundred () {
      this.hundredIndex++
      this.hundredData.push({num:0})
    },
    deleteHundred (index) {
      this.hundredIndex--
      this.hundredData.splice(index, 1,)
    },
    hundredDataBack(arr){
      let reward='';
      arr.forEach(item=>{
        reward+=item.num*10000+','
      })
      reward = reward.substring(0, reward.length - 1)
      return  reward
    },
    // 监控值修改过
    newerchangekillValue(val){
      this.newerchangekillValueShow=true
    },
    changeValue(val){
      this.changeValueShow=true
    },
    setValue(val){
      this.setValueShow=true
    },
    amountValue(val){
      this.amountShow=true
    },
    // 取消
    handleClose () {
      this.$emit('onHideDetails', false)
    },
  }
}
</script>

<style scoped lang="scss">
.btn-box-add {
  width: 50px;
  text-align: center;
  .el-button {
    height: 28px;
  }
}
.btn-box-delete {
  width: 50px;
  text-align: center;
  .el-button {
    height: 28px;
  }
}
</style>